#include <CurrentThread.h>

namespace CurrentThread
{
    thread_local std::thread::id cachedTid{0};
    thread_local std::string cachedName{""};
    void cacheTid()
    {
        if (cachedTid == static_cast<std::thread::id>(0))
        {
            cachedTid = std::this_thread::get_id();
            std::ostringstream oss;
            oss << std::string("Thread:") << cachedTid;
            cachedName = oss.str();
        }
    }
}
